﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Hydra.Shell.Enumerations;
using System.Linq;
using Hydra.Shell.Attributes;

namespace Hydra.Shell.Implementations
{
    public class HydraObjectWrapper
    {
        public ServiceLifetimeType GetLifetimeType(object obj)
        {
            var lifetimeAttribute = obj.GetType().GetCustomAttributes(true).OfType<ServiceLifetimeAttribute>().SingleOrDefault();

            if (lifetimeAttribute != null)
            {
                return lifetimeAttribute.LifetimeType;
            }
            else
            {
                return ServiceLifetimeType.NormalGarbageCollected;
            }
        }
    }
}
